<!DOCTYPE html>
<html>
<head>
    <title>Batch New Folders</title>
    <link rel="stylesheet" href="https://unpkg.com/element-plus/dist/index.css">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/vanta/0.5.24/vanta.waves.min.js"></script>
    <style>
        body {
            font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
            background: linear-gradient(135deg, #3a3a3a 0%, #c3cfe2 100%);
            color: #2c3e50;
            margin: 0;
            padding: 20px;
            min-height: 100vh;
        }
        h1 {
            text-align: center;
            margin-bottom: 40px;
            color: #1a202c;
            font-weight: 600;
            font-size: 32px;
            letter-spacing: -0.5px;
        }
        .container {
            max-width: 480px;
            margin: 40px auto;
            background: rgba(255, 255, 255, 0.98);
            border: 1px solid rgba(0, 0, 0, 0.06);
            padding: 48px;
            border-radius: 16px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
            backdrop-filter: blur(20px);
        }
        .form-group {
            margin-bottom: 32px;
        }
        .form-group label {
            display: block;
            margin-bottom: 12px;
            font-weight: 600;
            color: #2d3748;
            font-size: 15px;
            letter-spacing: 0.2px;
        }
        .path-selector {
            display: flex;
            gap: 16px;
            align-items: center;
        }
        .path-input {
            flex: 1;
            padding: 14px 18px;
            border: 1px solid #e8eaed;
            border-radius: 12px;
            background-color: #ffffff;
            color: #2c3e50;
            font-size: 14px;
            transition: all 0.3s ease;
        }
        .path-input:focus {
            outline: none;
            border-color: #4285f4;
            box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.12);
        }
        .browse-btn {
            padding: 14px 24px;
            background: #4285f4;
            border: none;
            border-radius: 12px;
            color: #ffffff;
            cursor: pointer;
            font-weight: 500;
            font-size: 14px;
            transition: all 0.3s ease;
        }
        .browse-btn:hover {
            background: #3367d6;
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(66, 133, 244, 0.25);
        }
        .folder-names {
            width: 90%;
            min-height: 120px;
            padding: 18px;
            border: 1px solid #e8eaed;
            border-radius: 12px;
            background-color: #ffffff;
            color: #2c3e50;
            font-size: 14px;
            resize: vertical;
            font-family: inherit;
            transition: all 0.3s ease;
            line-height: 1.6;
        }
        .folder-names:focus {
            outline: none;
            border-color: #4285f4;
            box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.12);
        }
        .create-btn {
            width: 100%;
            padding: 18px;
            background: #34a853;
            border: none;
            border-radius: 12px;
            color: #ffffff;
            font-size: 16px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            margin-top: 32px;
        }
        .create-btn:hover {
            background: #2d7d32;
            transform: translateY(-1px);
            box-shadow: 0 4px 16px rgba(52, 168, 83, 0.25);
        }
        .create-btn:disabled {
            background: #bdc3c7;
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
        }
        .status {
            margin-top: 24px;
            padding: 18px;
            border-radius: 12px;
            background-color: #f8f9fa;
            border: 1px solid #e8eaed;
            display: none;
            font-size: 14px;
            line-height: 1.6;
            text-align: center;
            font-weight: 600;
        }
        .status.success {
            background-color: #d4edda;
            border-color: #c3e6cb;
            color: #155724;
        }
        .status.error {
            background-color: #f8d7da;
            border-color: #f5c6cb;
            color: #721c24;
        }
        .status.info {
            background-color: #d1ecf1;
            border-color: #bee5eb;
            color: #0c5460;
        }
        .help-text {
            font-size: 13px;
            color: #718096;
            margin-top: 8px;
            line-height: 1.5;
        }
        .monitoring-status {
            margin-top: 20px;
            padding: 15px;
            border-radius: 8px;
            background-color: rgba(255, 255, 255, 0.05);
            border: 1px solid #333;
        }
        .monitoring-status h4 {
            margin: 0 0 10px 0;
            color: #40c9ff;
            font-size: 14px;
        }
        .monitoring-info {
            font-size: 12px;
            color: #ccc;
        }
        .monitoring-success {
            color: #4caf50;
        }
        .monitoring-failed {
            color: #f44336;
        }
        
        /* 窗口控制按钮样式 */
        .window-controls-bar {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 32px;
            background: rgba(0, 0, 0, 0.1);
            backdrop-filter: blur(10px);
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            display: flex;
            justify-content: space-between;
            align-items: center;
            z-index: 10000;
            -webkit-app-region: drag;
        }
        
        .window-title {
            color: rgba(255, 255, 255, 0.9);
            font-size: 13px;
            font-weight: 500;
            margin-left: 16px;
            letter-spacing: 0.3px;
            -webkit-app-region: drag;
        }
        
        .window-controls {
            display: flex;
            align-items: center;
            gap: 1px;
            margin-right: 8px;
            -webkit-app-region: no-drag;
        }
        
        .control-btn {
            width: 32px;
            height: 24px;
            border: none;
            outline: none;
            background: transparent;
            color: rgba(255, 255, 255, 0.9);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 4px;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            -webkit-app-region: no-drag;
        }
        
        .control-btn:hover {
            background: rgba(255, 255, 255, 0.1);
            color: rgba(255, 255, 255, 1);
            transform: translateY(-0.5px);
        }
        
        .control-btn:active {
            transform: translateY(0);
            background: rgba(255, 255, 255, 0.15);
        }
        
        .minimize-btn:hover {
            background: rgba(255, 193, 7, 0.15);
            color: #ffc107;
        }
        
        .maximize-btn:hover {
            background: rgba(40, 167, 69, 0.15);
            color: #28a745;
        }
        
        .close-btn:hover {
            background: rgba(220, 53, 69, 0.15);
            color: #dc3545;
        }
        
        .control-btn svg {
            display: block;
            width: 12px;
            height: 12px;
            color: inherit;
            fill: currentColor;
            stroke: currentColor;
            pointer-events: none;
            flex-shrink: 0;
        }
        
        /* 调整主容器的顶部边距，避免被窗口控制栏遮挡 */
        body {
            padding-top: 52px; /* 32px窗口控制栏高度 + 20px原有padding */
        }
    </style>
</head>
<body>
    <!-- 窗口控制按钮 -->
    <div class="window-controls-bar">
        <div class="window-title">Batch New Folders</div>
        <div class="window-controls">
            <button class="control-btn minimize-btn" onclick="minimizeWindow()" title="最小化">
                <svg viewBox="0 0 12 12" width="12" height="12">
                    <path d="M2 6h8" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
                </svg>
            </button>
            <button class="control-btn maximize-btn" onclick="toggleMaximize()" title="最大化">
                <svg viewBox="0 0 12 12" width="12" height="12">
                    <path d="M2 2h8v8H2z" fill="none" stroke="currentColor" stroke-width="1.5"/>
                </svg>
            </button>
            <button class="control-btn close-btn" onclick="closeWindow()" title="关闭">
                <svg viewBox="0 0 12 12" width="12" height="12">
                    <path d="M3 3l6 6M9 3l-6 6" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
                </svg>
            </button>
        </div>
    </div>
    
    <div class="container">
        <h1>批量新建文件夹</h1>
        
        <div class="form-group">
            <label for="targetPath">选择目标路径:</label>
            <div class="path-selector">
                <input type="text" id="targetPath" class="path-input" placeholder="请选择或输入目标路径" readonly>
                <button class="browse-btn" onclick="selectPath()">浏览</button>
            </div>
        </div>
        
        <div class="form-group">
            <label for="folderNames">文件夹名称: </label>
            <textarea id="folderNames" class="folder-names" placeholder="请输入文件夹名称，每行一个"></textarea>
            <div class="help-text">提示: 每行输入一个文件夹名称，支持中文和英文</div>
        </div>
        
        <button class="create-btn" onclick="createFolders()">批量创建文件夹</button>
        
        <div id="status" class="status" style="display: none;"></div>
        
        <!-- 监控状态显示区域 -->
        <div id="monitoring-status" class="monitoring-status" style="display: none;">
            <h4>用量监控状态</h4>
            <div id="monitoring-info"></div>
        </div>
    </div>
    
    <script src="batch-newFolder.js"></script>
</body>
</html>